package com.atguigu.gulimall.member.service;

import com.atguigu.gulimall.member.exception.PhoneExistException;
import com.atguigu.gulimall.member.exception.UsernameExistException;
import com.atguigu.gulimall.member.vo.MemberLoginVo;
import com.atguigu.gulimall.member.vo.MemberRegisterVo;
import com.atguigu.gulimall.member.vo.SocialUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.member.entity.MemberEntity;

import java.util.Map;

/**
 * 会员
 *
 * @author taotao
 * @email sunlightcs@gmail.com
 * @date 2021-07-13 18:55:19
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void register(MemberRegisterVo memberRegisterVo);

    /**
     * 由于impl会抛异常，所以在接口声明一下，让调用这个接口的人知道
     */
    void checkUniqueMobile(String phone) throws PhoneExistException;

    void checkUniqueUsername(String username) throws UsernameExistException;

    MemberEntity login(MemberLoginVo memberLoginVo);


    /**
     * 社交登录
     */
    MemberEntity login(SocialUser socialUser);
}

